from typing import Dict, Any

from dataclasses import dataclass


@dataclass
class WikiDocument:

    doc_id: str
    title: str
    doc_type: str
    url: str
    updated_at: int
    author: str
    metadata: Dict[str, Any]
    knowledge_base_id: str
    content: str | None = None

    def json(self):
        return {
            "doc_id": self.doc_id,
            "title": self.title,
            "doc_type": self.doc_type,
            "url": self.url,
            "updated_at": self.updated_at,
            "author": self.author,
            "metadata": self.metadata,
            "knowledge_base_id": self.knowledge_base_id,
            "content": self.content,
        }
